<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Models\Feedback;
use Illuminate\Http\Request;


class FeedbackController extends Controller {

    public function create(Request $request)
    {
        try {
            Feedback::create(array_merge(
                $request->post(),
                ['user_id' => auth('api')->id()]
            ));

            return $this->writeJson(0,null,'反馈成功');
        } catch (\Exception $exception) {
            return $this->writeJson(500,null,'反馈失败');
        }
    }

}
